<template>
<!-- 首页-推荐团课-选项卡 -->
  <div class="league">
    <div class="item" v-for="item in classData" :key="item.class_id">
      <div>
        <img :src="item.class_img" alt="">
      </div>
      <div class="itemText">
        <div class="itemName">
          <span>{{item.class_name}}</span>
          <span><img src="../assets/praise.svg"><span>5.0</span></span>
        </div>
        <span class="itemTime">
          <span>{{item.class_start_time.split(' ')[1]}} - {{item.class_end_time.split(' ')[1]}}</span>
          {{item.class_coatch}}
        </span>
        <div class="itemTarget">
          <span>{{item.class_tag}}</span>
        </div>
        <span class="introduce">{{item.class_introduce}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'League',
  props: ['classData']
}
</script>

<style scoped>
.item{
  padding: 1vw 2vw;
  display: flex;
  align-items: center;
}
.item img{
  width: 25vw;
  height: 25vw;
  border-radius: 2vw;
}
.item>.itemText{
  margin-left: 1.2vw;
  display: flex;
  flex-direction: column;
  color: #666;
  width: 69.5vw;
  font-size: 4vw;
}
.item>.itemText>.itemName,
.item>.itemText>.itemTime,
.item>.itemText>.itemTarget>span,
.item>.itemText>.introduce{
  margin: 1.2vw 0;
}
.item>.itemText>.itemName{
  display: flex;
  justify-content: space-between;
  color: #000;
  width: 100%;
}
.item>.itemText>.itemName>span:first-child{
  font-weight: bold;
  font-size: 5vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item>.itemText>.itemName>span:last-child{
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.item>.itemText>.itemName>span:last-child>img{
  width: 5vw;
  height: 5vw;
  margin-right: 2px;
}
.item>.itemText>.itemName>span:last-child>span{
  font-size: 4.5vw;
  line-height: 100%;
  display: inline-block;
  margin: auto 0;
  margin-bottom: 1px;
  color: #666;
}
.item>.itemText>.itemTime{
  color: #666;
}
.item>.itemText>.itemTime>span{
  color: #f00;
  font-weight: bold;
  margin-right: 4vw;
}
.item>.itemText>.itemTarget>span{
  display: inline-block;
  background-color: rgb(230, 230, 230);
  padding: 1vw 2vw;
  margin-right: 1vw;
  border-radius: 2vw;
}
.item>.itemText>.introduce{
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
</style>
